//
// Created by Administrator on 2020/5/19.
//

#include "q3.h"
#include<stdio.h>
#include <string.h>

void q32(char *s){
    char temp[100];
    int index[100];
    int size = 0;
    int max = 0;
    int length = strlen(s);
    int left = 0; //新的位置
    int j = 0;

    // 新的数组
    while(left < length) {
        for(j = 0; j < size; j++){
            if(s[left] == temp[j])
                break;
        }

        if(j >= size) {
            temp[size] = s[left];
            index[size] = left;
            size++;
            left++;
        } else {
            left = index[j] + 1;
            size = 0;
        }

        if(size > max) max = size;
    }

    printf("%d\n", max);
}